import React, { Component } from 'react'
import { Redirect, Route } from 'react-router-dom'

export default class PrivateRoute extends Component {
  render() {
      let userinfo=sessionStorage.getItem('userinfo')
    //   console.log(userinfo)
 
    return (
      <>
         {userinfo?
          <Route {...this.props}></Route>:
          <Redirect to='/login'></Redirect>}
     
      </>
    )
  }
}
